package cn.itcast.demo.web;

import cn.itcast.demo.config.PaymentProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.sql.DataSource;

/**
 * @author 虎哥
 */
@Slf4j
@RestController
public class HelloController {

    @Autowired
    private PaymentProperties properties;

    @Autowired
    private DataSource dataSource;

    @GetMapping("hello")
    public String hello(){
        log.debug("用户正在访问hello方法");

        return String.format("hello, 单笔最大限额：%d, 每日最大限额：%d，<br/> 用户：%s",
                properties.getMaxAmountPerDeal(), properties.getMaxAmountTotal(), properties.getUser());
    }
}
